<div class="field-wrapper">
    <label class="label" *ngIf="!componentData.extends?.noLabelTxt">{{componentData.labelText}}</label>
    <div class="field-control" [ngClass]="{'has-form-error': getComponentError(componentData.identifyId)}" nz-tooltip
        [nzTooltipTitle]="componentData.extends.tooltip">
        <ng-container *ngIf="!componentData.disabled;else disabledyTpl">
            <nz-select class="content border-form-item border-ctrl" [ngModel]="value"
            nzShowSearch
                (ngModelChange)="setBindData($event)" [nzMode]="selectMode"
                [nzPlaceHolder]="componentData.extends?.placeholder?componentData.extends?.placeholder:'请选择'+ componentData.labelText"
                [zeprideAuthority]="zeprideAuthorityData" [nzDisabled]="componentData.readonly">
                <ng-container *ngIf="dataSource && dataSource.length">
                    <nz-option *ngFor="let opt of dataSource" [nzValue]="opt.value" [nzLabel]="opt.key"></nz-option>
                </ng-container>
            </nz-select>
        </ng-container>
    </div>
    <span class="error-tip" [ngClass]="{'error-top-nolabel': componentData.extends?.noLabelTxt}"
        *ngIf="getComponentError(componentData.identifyId)">
        <ng-container *ngTemplateOutlet="errorTpl"></ng-container>
    </span>
</div>
<ng-template #errorTpl>{{getErrorMsg(componentData.identifyId)}}</ng-template>

<ng-template #disabledyTpl>
    <div class="field-control">
        {{readonlyValue}}
        <i *ngIf="dataChangeLog" class="iconfont icon-file-list-2-line icon-data-change" nz-popover
            [nzPopoverContent]="contentTemplate"></i>
    </div>
</ng-template>

<ng-template #contentTemplate>
    <div class="popover-content">
        <div>近期更正</div>
        <div>更正时间：{{dataChangeLog.time | date: 'yyyy年MM月dd日 HH:mm'}}</div>
        <div>更正内容：由“<span class="font-red">{{getChangeLogSource()}}</span>”更正为“<span
                class="font-bule">{{getChangeLogTarget()}}</span>”
        </div>
    </div>
</ng-template>

<!-- <ng-template #renderTemplate> [nzDropdownRender]="renderTemplate"
    <nz-divider></nz-divider>
    <div class="container">
        <input type="text" nz-input #inputElement />
        <a class="add-item">
            <i class="iconfont icon-add-line"></i>
            添加新的选项
        </a>
    </div>
</ng-template> -->